home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / PowerPlant / COffScreenPicture 2.0 / Ctest.cp < prev    next >
Encoding:
Text File  |  1997-07-15  |  2.5 KB  |  109 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. // Ctest.cp
  3. // ===========================================================================
  4. //
  5. #include <LGrowZone.h>
  6. #include <LWindow.h>
  7. #include <PP_Messages.h>
  8. #include <PP_Resources.h>
  9. #include <PPobClasses.h>
  10. #include <UDrawingState.h>
  11. #include <UMemoryMgr.h>
  12. #include <URegistrar.h>
  13. #include <LDialogBox.h>
  14.  
  15. #include "Ctest.h"
  16. #include "COffScreenPicture.h"
  17.  
  18.  
  19. // ===========================================================================
  20. // Main Program
  21. // ===========================================================================
  22.  
  23. void main(void){
  24.     // Set Debugging options
  25.     SetDebugThrow_(debugAction_Alert);
  26.     SetDebugSignal_(debugAction_Alert);
  27.  
  28.     InitializeHeap(3);                // Initialize Memory Manager
  29.                                     // Parameter is number of Master Pointer
  30.                                     //   blocks to allocate
  31.     
  32.     // Initialize standard Toolbox managers
  33.     UQDGlobals::InitializeToolbox(&qd);
  34.     
  35.     new LGrowZone(20000);            // Install a GrowZone function to catch
  36.                                     //    low memory situations.
  37.  
  38.     Ctest        theApp;
  39.     theApp.Run();
  40. }
  41.  
  42.  
  43. // ---------------------------------------------------------------------------
  44. // Constructor
  45. // ---------------------------------------------------------------------------
  46.  
  47. Ctest::Ctest(void){
  48.     RegisterAllPPClasses();
  49.     RegisterClass_(COffScreenPicture);
  50.  
  51.     LDialogBox::CreateWindow(1000, this);
  52. }
  53.  
  54.  
  55. // ---------------------------------------------------------------------------
  56. // Destructor
  57. // ---------------------------------------------------------------------------
  58.  
  59. Ctest::~Ctest(void){
  60. }
  61.  
  62.  
  63. #pragma mark -
  64.  
  65.  
  66. // ---------------------------------------------------------------------------
  67. // ObeyCommand
  68. // ---------------------------------------------------------------------------
  69.  
  70. Boolean    Ctest::ObeyCommand(CommandT inCommand, void *ioParam){
  71.     Boolean        cmdHandled = true;
  72.  
  73.     switch(inCommand){
  74.         case cmd_About:
  75.             break;
  76.  
  77.         default:
  78.             cmdHandled = LApplication::ObeyCommand(inCommand, ioParam);
  79.             break;
  80.     }
  81.     
  82.     return cmdHandled;
  83. }
  84.  
  85.  
  86. // ---------------------------------------------------------------------------
  87. // FindCommandStatus
  88. // ---------------------------------------------------------------------------
  89.  
  90. void    Ctest::FindCommandStatus(
  91.     CommandT    inCommand,
  92.     Boolean        &outEnabled,
  93.     Boolean        &outUsesMark,
  94.     Char16        &outMark,
  95.     Str255        outName){
  96.  
  97.     switch(inCommand){
  98.         case cmd_About:
  99.         case cmd_Quit:
  100.             outEnabled = true;
  101.             break;
  102.  
  103.         default:
  104.             LApplication::FindCommandStatus(inCommand, outEnabled,
  105.                                                 outUsesMark, outMark, outName);
  106.             break;
  107.     }
  108. }
  109.